﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace OnlineCooperation.Entity
{
    public class User
    {
        public int ID;                     //自动分配，唯一
        public String Name;           //唯一
        public String Email;           //唯一
        public String Pwd;
        public String Icon;            //头像的URL

        //空构造函数
        public User()
        {
            ID = 0;
            Name = null;
            Email = null;
            Pwd = null;
            Icon = null;         //初始化为默认头像！！！
        }

        //给定参数的构造函数
        public User(int id, String name, String email, String pwd, String icon)
        {
            ID = id;
            Name = name;
            Email = email;
            Pwd = pwd;
            Icon = icon;
        }

        public static bool operator ==(User u1, User u2)
        {
            if (u1.ID != u2.ID)
                return false;

            if (u1.Name != u2.Name)
                return false;

            if (u1.Pwd != u2.Pwd)
                return false;

            if (u1.Icon != u2.Icon)
                return false;

            return true;
        }

        public static bool operator !=(User u1, User u2)
        {
            return !(u1==u2);
        }
    }
}